package day1

import "fmt"

func T1() {
	num := []int{1, 2, 3}
	m := make(map[int]*int, 0)

	for k, v := range num {
		m[k] = &v
	}

	for k, v := range m {
		fmt.Println(k, "->", *v)
	}
}
func Defer_call() {
	defer func() { fmt.Println("打印前") }()
	defer func() { fmt.Println("打印中") }()
	defer func() { fmt.Println("打印后") }()
	panic("出发异常")
}

func Ap() {
	s := make([]int, 5)
	s = append(s, 1, 2, 3)
	fmt.Println(s)

	s1 := make([]int, 0)
	s1 = append(s1, 1, 2, 3)
	fmt.Println(s1)
}

func Equal() {
	s1 := struct {
		name string
		age  int
	}{
		name: "juice", age: 18,
	}

	s2 := struct {
		name string
		age  int
	}{
		name: "juice",
		age:  18,
	}
	if s1 == s2 {
		fmt.Println("s1==s2")
	}

	s3 := struct {
		name string
		m    map[string]string
	}{
		name: "juice", m: map[string]string{"age": "18"},
	}

	s4 := struct {
		name string
		m    map[string]string
	}{
		name: "juice", m: map[string]string{"age": "18"},
	}
	fmt.Println(s3, s4)
	//if s3 == s4 {
	//
	//}
}
